home *** CD-ROM | disk | FTP | other *** search
- Path: uni-erlangen.de!winx03!sunshine!schoof
- From: schoof@informatik.uni-wuerzburg.de (Jochen Schoof)
- Newsgroups: comp.lang.c
- Subject: Re: Beginer C please help me
- Date: 21 Mar 1996 12:58:50 GMT
- Organization: University of Wuerzburg, Germany
- Message-ID: <4irjqa$jtn@winx03.informatik.uni-wuerzburg.de>
- References: <DoLCFx.B7x.0.bloor@torfree.net> <4iq6uc$evq@daryl.scsn.net>
- NNTP-Posting-Host: wi2x01.informatik.uni-wuerzburg.de
- X-Newsreader: TIN [version 1.2 PL2]
-
- Scott Shrader (shrader@scsn.net) wrote:
- : In article <DoLCFx.B7x.0.bloor@torfree.net>, bz786@torfree.net says...
- : >
- : >This may be a stupid mistake but "please help" me.
- : >Thank you very much.
- : >
- : >#include <stdio.h>
- : >#include <math.h>
- : >main ()
- : >{
- : >float n;
- : >n=(9/5);
- : >printf ("n= %1.3f\n", n);
- : >}
- : >I have complied and run the programme & I got the answer n=1.000
- : >but Iam supposed to get answer 1.8.
- : >Why I got this answer?
- : >--
- : you can write this by skipping printf("n= %1.3f\n", n); and put in
- : printf("%f",n);
- :
- : Try this to see how this works.
-
- What you wrote is complete nonsense. How about testing the programs
- before posting them..? Even learning C might be of help.
-
- : I'm a bit new at this too, but I think this will work.
-
- If you have to use phrases like "I think it will work" or "I'm not sure"
- in your posting, please don't post it. There are enough folks around
- here who know for sure - especially in elementary cases like this one.
-
- - Jochen
-
- --
- --------------------------------------------------------------------------
- Jochen Schoof mailto:schoof@informatik.uni-wuerzburg.de
- Lehrstuhl fuer Informatik II +-------------------------------------------
- Universitaet Wuerzburg | You are just reading a .sig-light:
- D-97074 Wuerzburg (Germany) | It is free of fat, sugar and cholesterol!
- ------------------------------+-------------------------------------------
- WWW-Homepage: http://www.informatik.uni-wuerzburg.de/staff/joscho
- --------------------------------------------------------------------------
-